<template>
    <el-form ref="assetRepairFormRef" :model="formData" :class="form-item" :rules="rules" :size="size" status-icon>
        <el-row>
            <el-col :span="7">
            
            <el-form-item class="form-item" prop="assetCode" label="故障名称" label-width="80px">
                <el-input v-model="props.assetForm.assetCode" autocomplete="off"/>
            </el-form-item>
            </el-col>
            <el-col :span="7">
            <el-form-item class="form-item" prop="assetName" label="故障类型：" label-width="100px">
                <el-input v-model="props.assetForm.assetName" autocomplete="off" />
            </el-form-item>
            </el-col>
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="category" label="资产类别：" label-width="60px">
                <el-input v-model="props.assetForm.category" autocomplete="off" />
            </el-form-item>
            </el-col> 
            
        </el-row>
        <el-row>
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="status" label="资产状态：" label-width="80px">
                <el-tree-select
                v-model="props.assetForm.status"
                :data="departmentdata"
                :props="treeProps"
                :render-after-expand="false"
                />
            </el-form-item>
            </el-col>  
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="purchaseDate" label="采购时间：" label-width="80px">
                <el-input v-model="props.assetForm.purchaseDate" autocomplete="off"/>
            </el-form-item>
            </el-col>   
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="warrantyExpiry" label="维保到期时间：" label-width="80px">
                <el-input v-model="props.assetForm.warrantyExpiry" autocomplete="off" />
            </el-form-item>
            </el-col>  
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="price" label="资产价格：" label-width="80px">
                <!-- <el-input v-model.number="props.assetForm.price" autocomplete="off" /> -->
                <el-input-number v-model="props.assetForm.price" :min="0" :step="0.01" />
            </el-form-item>
            </el-col>  
        </el-row>
        <el-row>
            <el-col :span="7">
            <el-form-item class="form-item" prop="location" label="存放地域：" label-width="80px">
                <el-input v-model="props.assetForm.location" autocomplete="off" />
            </el-form-item>
            </el-col>
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="bizIp" label="业务IP：" label-width="80px">
                <el-input v-model="props.assetForm.bizIp" autocomplete="off"/>
            </el-form-item>
            </el-col>  
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="ibmcIp" label="管理IP：" label-width="90px">
                <el-input v-model="props.assetForm.ibmcIp" autocomplete="off"/>
            </el-form-item>
            </el-col> 
            <el-col :span="7">  
            <el-form-item  class="form-item" prop="custodian" label="资产负责人：" label-width="90px">
                <el-input v-model="props.assetForm.custodian" autocomplete="off"/>
            </el-form-item>
            </el-col> 
        </el-row>
    </el-form>
    <div class="dialog-footer">
    <el-button @click="clear()">清空</el-button>
    <el-button type="primary" @click="submitForm">
        提交
    </el-button>
    </div>
</template>

<script setup>
import { defineProps, defineEmits,reactive, ref, onBeforeMount, toRefs, onMounted} from 'vue'
import {getDepartmentList} from "../../api/department.js"
</script>
<style scoped>
.form-item{
  width: 300px;
  margin: 10px auto;
}
</style>